package com.headwind.logistics.log.Listener;

import com.headwind.logistics.log.util.MySessionContext;

import javax.servlet.annotation.WebListener;
import javax.servlet.http.HttpSessionEvent;
import javax.servlet.http.HttpSessionListener;

/**
 * @Author 小恶魔
 * @Date 2020-07-21 10:48
 * @Version 1.0
 * @DESCRIPTION session监听器
 */
@WebListener
public class MySessionListener implements HttpSessionListener {
    public void sessionCreate(HttpSessionEvent sessionEvent) {
        MySessionContext.addSession(sessionEvent.getSession());
    }

    public void sessionDestroy(HttpSessionEvent sessionEvent) {
        MySessionContext.removeSession(sessionEvent.getSession());
    }
}
